#include<bits/stdc++.h>

using namespace std;

bool inc(int x, int y) {
    return x < y;
}

bool dec(int x, int y) {
    return x > y;
}

void bubble_sort(int *a, int *b, bool(*comp)(int, int)) {
    int n = b - a;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= n - i - 2; j++) {
            if (comp(a[j], a[j + 1]) == false)swap(a[j], a[j + 1]);
        }
    }
}

int main() {
    int a[] = {1, 3, 5, 7, 9, 2, 4, 6, 8, 0};
    bubble_sort(a, a + 10, dec);
    for (int i = 0; i < 10; i++) {
        cout << a[i] << " ";
    }

}
